#pragma once

#include "smvec3f.h"
#include "smmatrix44f.h"


class CCamera
{
public:
	CCamera(void);
	~CCamera(void);
	void Set(const smVec3f& eye,
			const smVec3f& center,
		const smVec3f& up,
		float near,
		float ratio,
		float fovy);
	void Forward(float step);
	void Backward(float step);
	void Left(float step);
	void Right(float step);
	void Up(float step);
	void Down(float step);
	const smVec3f& GetEyePoint() const; 
	smVec3f PointModelViewTransform(const smVec3f& v3) const;
	smVec3f VectorModelViewTransform(const smVec3f& v3) const;

protected:
	void GenerateModelViewMatrix();
	void update();

public:
	smVec3f mEye;
	smVec3f mUp;
	smVec3f mCenter;
	float mNear;
	float mRatio;
	float mFovy;
protected:
	smMatrix44f mModelView;
	smVec3f mOriginalPreCompute;
};

